<?php

namespace App\Http\Controllers\Admin\Business\Repository;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Http\Controllers\Admin\Business\Repository\Combo
 *
 * @property int $id
 * @property string|null $title 套餐名称
 * @property string|null $thumb 套餐封面
 * @property float $price 价格
 * @property int $times 包含次数
 * @property string|null $desc 描述
 * @property string|null $content 详情
 * @property int|null $rate_type 1.按系统设置2.自定义
 * @property float $rate 返利比率
 * @property float|null $top_rate
 * @property int|null $sort
 * @property int|null $status 是否上架1是2否
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @property int|null $is_bind
 * @property float|null $zhilv_price 智旅价格
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereContent($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereDesc($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereIsBind($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo wherePrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereRate($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereRateType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereSort($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereThumb($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereTimes($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereTopRate($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Http\Controllers\Admin\Business\Repository\Combo whereZhilvPrice($value)
 * @mixin \Eloquent
 */
class Combo extends Model
{
    //
    protected $table = 'combos';
    public static function getSelectOptions()
    {
        $options = \DB::table('combos')->select('id','title as text')->get();
        $selectOption = [];
        foreach ($options as $option){
            $selectOption[$option->id] = $option->text;
        }

        return $selectOption;
    }
}
